package com.ficus.road.maintain.util;

import com.ficus.road.maintain.core.model.zh.MileageStatistic;

import java.util.Comparator;

public class MileageUtil implements Comparator<MileageStatistic.MileageBridge> {
    @Override
    public int compare(MileageStatistic.MileageBridge o1, MileageStatistic.MileageBridge o2) {
        if (o1.getRoadName() == null && o2.getRoadName() == null) {
            return 0;
        } else if (o1.getRoadName() == null) {
            return 1; // o1排在后面
        } else if (o2.getRoadName() == null) {
            return -1; // o2排在后面
        } else {
            return 0; // 其他情况不改变顺序
        }
    }
}